#ifndef TYPES_H_INCLUDED
#define TYPES_H_INCLUDED

/** \file types.h
*   \brief Define basic types
*/


//defines
#define EIGHTNEIGHBOURHOOD 8
#define FOURNEIGHBOURHOOD 4


//class e types
/** \class Position
*   \brief Position in cartesian coordinates, quantized, used for position of pixels in images
*/
class Position{
    public:
        ///x coordinate
        int x;
        ///y coordinate
        int y;

        ///Constructor.
        Position();

        ///Constructor with initial params
        /// \param x Initial value for x
        /// \param y initial value for y
        Position(int x ,int y);

        ///Say if is inside(not in) a rectangle
        ///\param xmin x coordinate of minimum vertice
        ///\param ymin y coordinate of minimum vertice
        ///\param xmax x coordinate of maximum vertice
        ///\param ymax y coordinate of maximum vertice
        ///\return True if is inside
        bool isInside(int xmin,int ymin,int xmax, int ymax);

        ///Say if all coordinates are positive
        ///\return True if all coordinates are positive
        bool isPositive();

        ///Compare Positions
        ///\param a Position that will be compared
        ///\return If are equals return true else return false
        bool operator==(Position a);

        ///Compare Positions
        ///\param a Position that will be compared
        ///\return If are diferents return true else return false
        bool operator!=(Position a);

        ///Plus two Positions
        ///\param a Position that will be plus
        ///\return Position
        Position operator+(Position a);


};

class R3{
    public:
        float x;
        float y;
        float z;

        R3();

        R3(float a,float b,float c=0);

        ///Compare vectors
        ///\param a R3 that will be compared
        ///\return If are equals return true else return false
        bool operator==(R3 a);

        ///Compare
        ///\param a R3 that will be compared
        ///\return If are diferents return true else return false
        bool operator!=(R3 a);

        ///Plus
        ///\param a R3 that will be plus
        ///\return R3
        R3 operator+(R3 a);

        ///Minus
        ///\param a R3
        ///\return R3
        R3 operator-(R3 a);

        ///Dot/inner product
        ///\param a R3
        ///\return Value
        float operator*(R3 a);

        ///inverse
        ///\param a R3 that will be plus
        void operator-();

        R3 getNormalized();

        void normalize();

    private:

};

typedef R3 Point;
typedef R3 Vector;

Point pointfromposition(Position a);

typedef float Radians;


#endif // TYPES_H_INCLUDED
